﻿<phone:PhoneApplicationPage 
    x:Class="Vanglen.YDLMSCP.DetailList"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:Vanglen.YDLMSCP"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="696"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True" Loaded="PhoneApplicationPage_Loaded"
    local:TiltEffect.IsTiltEnabled="True">

    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <!--枢轴控件-->
        <controls:Pivot Name="pivot1" Title="意大利美食菜谱" SelectionChanged="pivot1_SelectionChanged">
            <!--枢轴项一-->
            <!--<controls:PivotItem Header="查询" Visibility="Collapsed">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="80"></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Orientation="Horizontal">
                        <TextBox Name="tbFilter" Text="" Width="375" TextChanged="tbFilter_TextChanged"></TextBox>
                        <Button Name="btnSearch" Width="80" Click="btnSearch_Click">
                            <Button.Background>
                                <ImageBrush ImageSource="/Vanglen.YDLMSCP;component/img/appbar.feature.search.rest.png" />
                            </Button.Background>
                        </Button>
                    </StackPanel>
                    <StackPanel Grid.Row="1">
                        <ListBox x:Name="lbSearch" FontSize="{StaticResource PhoneFontSizeLarge}" ItemsSource="{Binding}" Tap="pList_Tap">
                            <ListBox.ItemContainerStyle>
                                <Style TargetType="ListBoxItem">
                                    <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                                </Style>
                            </ListBox.ItemContainerStyle>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <TextBlock TextWrapping="Wrap" Height="60" Margin="12,0,12,0" Text="{Binding name}" Style="{StaticResource PhoneTextTitle3Style}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </StackPanel>
                </Grid>
            </controls:PivotItem>-->

            <!--枢轴项二-->
            <controls:PivotItem Header="所有菜谱">
                <Grid>
                    <ListBox x:Name="lbAll" FontSize="{StaticResource PhoneFontSizeLarge}" ItemsSource="{Binding}" Tap="pList_Tap">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock TextWrapping="Wrap" Height="60" Margin="12,0,12,0" Text="{Binding name}" Style="{StaticResource PhoneTextTitle3Style}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
            <!--枢轴项三-->
            <controls:PivotItem Header="收藏菜谱">
                <Grid>
                    <ListBox x:Name="lbFavorite" FontSize="{StaticResource PhoneFontSizeLarge}" ItemsSource="{Binding}" Tap="pList_Tap">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock TextWrapping="Wrap" Height="60" Margin="12,0,12,0" Text="{Binding name}" Style="{StaticResource PhoneTextTitle3Style}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
            <!--枢轴项四-->
            <controls:PivotItem Header="已查看菜谱">
                <Grid>
                    <ListBox x:Name="lbViewed" FontSize="{StaticResource PhoneFontSizeLarge}" ItemsSource="{Binding}" Tap="pList_Tap">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock TextWrapping="Wrap" Height="60" Margin="12,0,12,0" Text="{Binding name}" Style="{StaticResource PhoneTextTitle3Style}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
            <!--枢轴项五-->
            <controls:PivotItem Header="随机菜谱">
                <Grid>
                    <ListBox x:Name="lbRandom" FontSize="{StaticResource PhoneFontSizeLarge}" ItemsSource="{Binding}" Tap="pList_Tap">
                        <ListBox.ItemContainerStyle>
                            <Style TargetType="ListBoxItem">
                                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            </Style>
                        </ListBox.ItemContainerStyle>
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <TextBlock TextWrapping="Wrap" Height="60" Margin="12,0,12,0" Text="{Binding name}" Style="{StaticResource PhoneTextTitle3Style}" />
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--演示 ApplicationBar 用法的示例代码-->
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton x:Name="appbar_button1" IconUri="/img/dark/appbar.refresh.rest.png" Text="刷新" Click="appbar_button1_Click"/>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>